Weighted Union Find
概略
要素間の距離/重みを考慮した
Union Find
同一集合内の二点間の距離を
$ O(\alpha)
で計算
実装
マージする際に重みを調整して2集合の根の距離に変更
weight
を呼ぶ前には必ず
root
を呼んで重みを更新する必要がある